# http://nmap.org/nsedoc/scripts/ssl-heartbleed.html
#
# sudo nmap -sV --script=ssl-heartbleed -p443 <target>
# target : hostname or range 192.168.199.0/24
#
# 'ssl-heartbleed' did not match 
# https://svn.nmap.org/nmap/scripts/ssl-heartbleed.nse
# http://hackertarget.com/testing-heartbleed-with-the-nmap-nse-script/
#

my $numberOfArg = $#ARGV + 1;
my $target = $ARGV[0];
my $opt = "-sV --script=ssl-heartbleed -p443";

&printHelp if $numberOfArg == 0;

$cmd =  sprintf("sudo nmap $host $opt");
system($cmd);

sub printHelp {
    print "syntax : cmd target\n";
    print "\n";
    print "- note -\n";
    print "if you see 'ssl-heartbleed' did not match like that.\n";
    print "check this site : http://hackertarget.com/testing-heartbleed-with-the-nmap-nse-script\n";
    exit;
}
